package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
//@Mapper注解要定义成一个接口,接口交给Spring进行管理,不用写Mapper映射文件xml，接口生成一个实现类，让别的类进行引用
@Mapper
public interface UserMapper extends BaseMapper<User> {
    Integer save(User user);

    List<User> selectUsers();

    User getUser(@Param("id") Integer id);

    Integer deleteUser(@Param("id") Integer id);

    Integer updateUser(User user);

    List<User> selectUsersByPage(@Param("offset") long offset,@Param("pageSize") long pageSize);
}
